package com.bitcola.security.admin.rest;

import com.bitcola.security.admin.biz.ColaFinancialRecordsBiz;
import com.bitcola.security.common.msg.AppResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 统计信息
 *
 * @date 2019/11/17 11:57
 */
@RestController
@RequestMapping("/statistics")
public class ColaInancialRecordsController {

    @Autowired
    private ColaFinancialRecordsBiz colaFinancialRecordsBiz;

    /**
     * 查询报表
     *
     * @param params
     * @return
     */
    @GetMapping("/financialRecords")
    public AppResponse statistics(@RequestParam Map<String, Object> params) {
        Long startTime = Long.parseLong(params.get("startTime").toString());
        Long endTime = Long.parseLong(params.get("endTime").toString());
        String interval = params.get("interval").toString();
        return colaFinancialRecordsBiz.statistics(startTime, endTime, interval);
    }


}
